using System;
using Rhino.Mocks;
using Rhino.Mocks.Interfaces;

namespace IssueExplorer.UnitTest.Base.BDD
{
    public static class RhinoMocksExtensions
    {
        public static void was_told_to<T>(this T mock, Action<T> item)
        {
            mock.AssertWasCalled(item);
        }

        public static IMethodOptions<R> when_told_to<T, R>(this T mock, Function<T, R> func) where T : class

        {
            return mock.Stub(func).Repeat.Any();
        }

        public static IMethodOptions<R> setup_result<T, R>(this T mock, Function<T, R> func) where T : class
        {
            return mock.Stub(func).Repeat.Any();
        }
    }
}